<?php

/**
 * Controller_disease
 * 因病缺课管理
 */

class Controller_disease extends MyApp {

	public function __construct()
	{

		parent::__construct();

		$this->model->grade   		= YOU::loadModel('grade');
		$this->model->class   		= YOU::loadModel('class');
		$this->model->semester   	= YOU::loadModel('semester');

	}
	/** 首页 **/
	public function actionIndex()
	{

	}
	/** 二级联动 **/
	public function actionListJson ()
	{
		$class_id = (int)$this->get->class_id;
		$student_lists = $this->db->fetchAll("SELECT `student_name`,`student_id` FROM `tbl_student` WHERE class_id='{$class_id}'");
		if(!empty($student_lists)){
			echo json_encode($student_lists);
		}else{
			exit("0");
		}
	}
	/** -------------------------------------病症名称--------------------------------- **/
	/** 病症名称列表 **/
	public function actionNameList ()
	{
		// 分页
		YOU::loadLib('page', "", '0');
		$tmp = $this->db->fetchRow("SELECT COUNT(1) AS count FROM `tbl_disease` ");
		$count = $tmp['count'];
		$page_total = ceil($count/PAGE_LIMIT);
		// 当前页
		$p = intval($_GET['p']);
		if ($p == 0){
			$p  = 1;
		}
		if ($p > 1){
			$start = PAGE_LIMIT * ($p-1);
		}else{
			$start = 0;
		}
		$disease_lists = $this->db->fetchAll("SELECT * FROM `tbl_disease` ORDER BY disease_id DESC LIMIT {$start}, ".PAGE_LIMIT."");

		$page = new Page(array('total' => $count, 'perpage' => PAGE_LIMIT));
		$page->next_page   = '下一页>';
		$page->pre_page    = '<上一页';
		$page->style_path  = "static/page_style";

		$this->tpl->assign("page", $page->show(4, "yahoo"));
		$this->tpl->assign("disease_lists", $disease_lists);
		$this->tpl->display('disease/name.list.tpl.php');
	}

	/** 疾病名称修改 **/
	public function actionNameUpdate()
	{
		$disease_id	 = (int)$this->get->disease_id;
		// 班级
		$disease_data = $this->db->fetchRow("SELECT * FROM `tbl_disease` WHERE disease_id={$disease_id}");

		if (empty($disease_data)){
			Helper_Client::alert("疾病不存在");
		}

		if ($_POST){

			$disease_name   		= $this->post->disease_name;
			$disease_code   		= $this->post->disease_code;

			// 写入数据库
			$info = array(

			"disease_name"       	=> $disease_name,
			"disease_code"       	=> $disease_code,
			"status"                => 1,
			"create_time"           => date("Y-m-d H:i:s"),
			"update_time"           => "0000-00-00 00:00:00",

			);

			$this->db->do_update("tbl_disease", $info, "disease_id='{$disease_id}'");

			// 跳转
			Helper_Client::location("修改成功", "index.php?a=disease.namelist");

		}

		$this->tpl->assign("disease_data", $disease_data);
		$this->tpl->display("disease/name.update.tpl.php");
	}

	/** ---------------------------------------登记说明------------------------------- **/

	/** 登记说明修改 **/
	public function actionExplainUpdate()
	{

		// 登记说明
		$explain_data = $this->db->fetchRow("SELECT * FROM `tbl_disease_explain`");

		if (empty($explain_data)){
			Helper_Client::alert("疾病不存在");
		}

		if ($_POST){

			$explain_content   		= $this->post->explain_content;

			// 写入数据库
			$info = array(

			"explain_content"       => $explain_content,
			"status"                => 1,
			"create_time"           => date("Y-m-d H:i:s"),
			"update_time"           => "0000-00-00 00:00:00",

			);

			$this->db->do_update("tbl_disease_explain", $info, "explain_id='1'");

			// 跳转
			Helper_Client::location("修改成功", "index.php?a=disease.explainupdate");

		}

		$this->tpl->assign("explain_data", $explain_data);
		$this->tpl->display("disease/explain.update.tpl.php");
	}

	/** -------------------------------------登记------------------------------------- **/
	/** 登记添加 **/
	public function actionAdd()
	{
		// 班级
		$class_lists = $this->model->class->getAll();
		// 病状名称
		$disease_lists = $this->db->fetchAll("SELECT * FROM `tbl_disease` ");
		// 学生姓名
		$student_lists = $this->db->fetchAll("SELECT `student_id`,`student_name`  FROM `tbl_student` ");
		// 登记说明
		$explain_data = $this->db->fetchRow("SELECT *  FROM `tbl_disease_explain` ");

	
		
		if ($_POST && $_GET){
            $create_time   		= $this->post->from;
            $update_time   		= $this->post->to;
            $len =  (strtotime($update_time) - strtotime($create_time))/86400;
            $days = array($create_time);
            if($len>0){
                for($i=1;$i<$len;$i++){
                    $days[] = date("Y-m-d",strtotime($create_time)+86400*$i);
                }
                $days[] = $update_time;
            }
            foreach ($days as $key => $value){
            // 当前时间

            $time =  $value;
            // 获得当前学期周次、月、学期
            $semester_data = $this->model->semester->getNew();
            $semester_id   = $semester_data['semester_id'];
            $semester_ss = $this->model->semester->getWeekByTime($time);

			$class_id   		= $this->post->class_id;
			$student_id   		= $this->post->student_id;
			$lack_while   		= $this->post->lack_while;

			$disease_id   		= $this->post->disease_id;
			$lack_doctor   		= $this->post->lack_doctor;
			$lack_rests   		= $this->post->lack_rests;
			// 获得年级id
			$row = $this->model->class->getInfo($class_id);
			$grade_id = $row['grade_id'];
			// 写入数据库
			$info = array(

			"class_id"  		=> $class_id,
			"grade_id"  		=> $grade_id,
			"student_id"       	=> $student_id,
			"lack_while"       	=> $lack_while,
			"start_time"       	=> $value,
			"end_time"       	=> $update_time,
			"disease_id"       	=> $disease_id,
			"lack_doctor"       => $lack_doctor,
			"lack_rests"        => $lack_rests,
			"semester_id"     	=> $semester_id,
			"semester_week"     => $semester_ss['week_number'],
			"semester_month"    => $semester_ss['semester_month'],
			"status"            => 1,
			"create_time"       => date("Y-m-d H:i:s"),
			"update_time"       => "0000-00-00 00:00:00",

			);

			$this->db->do_insert("tbl_lack", $info);
            }

			Helper_Client::location("添加成功", "index.php?a=disease.daydetails");

		}
		$this->tpl->assign("disease_lists", $disease_lists);
		$this->tpl->assign("student_lists", $student_lists);
		$this->tpl->assign("class_lists", $class_lists);
		$this->tpl->assign("explain_data", $explain_data);

		$this->tpl->assign("pretend_in", $pretend_in);
		$this->tpl->display("disease/m.add.tpl.php");
	}
	/** -------------------------------------日报表------------------------------------- **/
	/** 日列表 **/
	public function actionDayList ()
	{
		// 分页
		YOU::loadLib('page', "", '0');
		$tmp = $this->db->fetchRow("SELECT COUNT(1) AS count FROM `tbl_manage` AS a,`tbl_grade_up` AS b WHERE b.is_now=1 AND a.grade_id=b.grade_id {$where}");
		$count = $tmp['count'];
		$page_total = ceil($count/PAGE_LIMIT);
		// 当前页
		$p = intval($_GET['p']);
		if ($p == 0){
			$p  = 1;
		}
		if ($p > 1){
			$start = PAGE_LIMIT * ($p-1);
		}else{
			$start = 0;
		}

		$lack_lists = $this->db->fetchAll("SELECT a.*,b.class_name FROM `tbl_lack` AS a ,`tbl_class` AS b  WHERE a.class_id = b.class_id ORDER BY a.lack_id DESC LIMIT {$start}, ".PAGE_LIMIT."");

		$page = new Page(array('total' => $count, 'perpage' => PAGE_LIMIT));
		$page->next_page   = '下一页>';
		$page->pre_page    = '<上一页';
		$page->style_path  = "static/page_style";

		$this->tpl->assign("page", $page->show(4, "yahoo"));
		$this->tpl->assign("lack_lists", $lack_lists);
		$this->tpl->display('disease/day.list.tpl.php');
	}
	/** 日列表详情 **/
	public function actionDayDetails ()
	{
		// 年级
		$grade_lists = $this->model->grade->getall();
		// 当前时间
		$time =  date('Y-m-d ',time());;
		// 搜索
		$grade_id	= (int)$this->get->grade_id;
		$start_time	=      $this->get->start_time;

		$where = "";
		$wheres = "";
		if (!empty($grade_id)){
			$wheres = " AND a.grade_id ='{$grade_id}' ";
			$this->tpl->assign("grade_id", $grade_id);
			print_R($where);
		}
		if (!empty($start_time)){
			$where = " AND a.start_time ='{$start_time}' ";
			$this->tpl->assign("start_time", $start_time);
		}else {
			$where = " AND a.start_time ='{$time}' ";

		}

		// 登记说明
		$explain_data = $this->db->fetchRow("SELECT *  FROM `tbl_disease_explain` ");
		// 症状名称
		$disease_lists = $this->db->fetchAll("SELECT *  FROM `tbl_disease` ");
		// 分页
		YOU::loadLib('page', "", '0');
		$tmp = $this->db->fetchRow("SELECT COUNT(1) AS count FROM `tbl_lack` AS a ,`tbl_class` AS b  WHERE a.class_id = b.class_id {$where} {$wheres}");
		$count = $tmp['count'];
		$page_total = ceil($count/PAGE_LIMIT);
		// 当前页
		$p = intval($_GET['p']);
		if ($p == 0){
			$p  = 1;
		}
		if ($p > 1){
			$start = PAGE_LIMIT * ($p-1);
		}else{
			$start = 0;
		}

		$lack_lists = $this->db->fetchAll("SELECT a.*,b.class_name FROM `tbl_lack` AS a ,`tbl_class` AS b  WHERE a.class_id = b.class_id  {$where} {$wheres} ORDER BY a.lack_id DESC LIMIT {$start}, ".PAGE_LIMIT."");
//print_R("SELECT a.*,b.class_name FROM `tbl_lack` AS a ,`tbl_class` AS b  WHERE a.class_id = b.class_id  {$where} {$wheres} ORDER BY a.lack_id DESC LIMIT {$start}, ".PAGE_LIMIT."");
		foreach($lack_lists as $key=>$value){
			
			$student_data= $this->db->fetchRow("SELECT `student_sex`,`student_name` FROM `tbl_student` WHERE student_id={$value['student_id']} ");
			// 姓名
			$lack_lists[$key]['student_name'] =$student_data['student_name'];
			// 性别
			$lack_lists[$key]['student_sex'] =$student_data['student_sex'];
			// 缺课天数
			$start_time = strtotime($value['start_time']);
			$end_time = strtotime($value['end_time']);
			$lack_lists[$key]['day'] =($end_time - $start_time)/86400;
		}

		$page = new Page(array('total' => $count, 'perpage' => PAGE_LIMIT));
		$page->next_page   = '下一页>';
		$page->pre_page    = '<上一页';
		$page->style_path  = "static/page_style";

		$this->tpl->assign("page", $page->show(4, "yahoo"));
		$this->tpl->assign("lack_lists", $lack_lists);
		$this->tpl->assign("explain_data", $explain_data);
		$this->tpl->assign("disease_lists", $disease_lists);

		$this->tpl->assign("time", $time);
		$this->tpl->assign("grade_lists", $grade_lists);
		$this->tpl->display('disease/m.day.details.tpl.php');
	}
	/** ------------------------------------ 周报表 ------------------------------------- **/
	/** 周列表 **/
	public function actionWeekList ()
	{
		// 获得所有学期
		$semester_lists =  $this->model->semester->getall();

		// 搜索
		$semester_id	= (int)$this->get->semester_id;
		$semester_week	= (int)$this->get->semester_week;

		$where = "";
		$wheres = "";
		if (!empty($semester_id)){

			$wheres = " AND a.semester_id ={$semester_id} ";

			$this->tpl->assign("semester_id", $semester_id);
		}
		if (!empty($semester_week)){
			$where = " AND a.semester_week ={$semester_week} ";
			$this->tpl->assign("semester_week", $semester_week);
		}
		if (empty($semester_id)) {
			// 获得当前学期
			$semester_data = $this->model->semester->getNew();
			$semester_id   = $semester_data['semester_id'];
		}
		if (empty($semester_week)) {
			// 获得时间周次
			$semester_week = $this->model->semester->getWeekCount($semester_id);
		}
		// 学期名称
		$semester_data = $this->model->semester->getInfo($semester_id);
		// 当前周的开始时间和结束时间
		$semester_time = $this->model->semester->getWeekInfo($semester_id,$semester_week);
//var_dump($semester_time);
		// 登记说明
		$explain_data = $this->db->fetchRow("SELECT *  FROM `tbl_disease_explain` ");

		// 学校信息
		$baseset_data = $this->db->fetchRow("SELECT * FROM `tbl_baseset` ");
		// 学校地区类别
		$baseset_data['baseset_area'] = $this->area_ini[$baseset_data['baseset_area']];
		// 地区类别
		$baseset_data['baseset_registered'] = $this->registered_ini[$baseset_data['baseset_registered']];

		// 学生总人数
		$student_count = $this->db->fetchRow("SELECT COUNT(*) AS count FROM `tbl_student`");

		// 男所有人数
		$man_count = $this->db->fetchRow("SELECT COUNT(*) AS count FROM `tbl_student`AS a WHERE student_sex = '1' ");

		// 女所有人数
		$woman_count = ($student_count['count']-$man_count['count']);

		// 请假数量
		$row = (int)$this->db->fetchAll("SELECT DISTINCT a.student_id FROM `tbl_lack` AS a,`tbl_student` AS b,`tbl_week` AS c WHERE a.student_id=b.student_id {$where}   GROUP BY a.student_id");

		//  出勤数量
		$row = (int)$student_count['count'] -$row;

		// 出勤率
		$percent = round($row/$student_count['count']*100,2)."%";

		// 疾病列表
		$disease_lists = $this->db->fetchAll("SELECT disease_id,disease_name FROM `tbl_disease`");
		foreach ($disease_lists as $key => $value){
			$disease_ini[$value['disease_id']] = $value['disease_name'];
		}

        $countall = 0;
		// 年级列表
		$grade_lists = $this->db->fetchAll("SELECT grade_id,grade_name FROM `tbl_grade_up` WHERE is_now =1");
		foreach ($grade_lists as $key => $value){

            //男
            $row  = $this->db->fetchRow("select count(DISTINCT l.student_id) as count from `tbl_lack` as l , `tbl_student` as s where l.student_id = s.student_id AND s.student_sex =1 AND s.grade_id = {$value['grade_id']} and l.semester_id = {$semester_id} and l.semester_week = {$semester_week}");
            $grade_lists[$key]['boy'] = $row['count'];
            $countall += $row['count'];

            //女
            $row  = $this->db->fetchRow("select count(DISTINCT l.student_id) as count from `tbl_lack` as l , `tbl_student` as s where l.student_id = s.student_id AND s.student_sex =0 AND s.grade_id = {$value['grade_id']}  and l.semester_id = {$semester_id} and l.semester_week = {$semester_week}");
            $grade_lists[$key]['girl'] = $row['count'];
            $countall += $row['count'];

            foreach ($disease_lists as $k => $v){//疾病
                //男
            $row  = $this->db->fetchRow("select count(DISTINCT l.student_id) as count from `tbl_lack` as l , `tbl_student` as s where l.student_id = s.student_id AND s.student_sex =1 AND l.disease_id = {$v['disease_id']} AND s.grade_id = {$value['grade_id']} and l.semester_id = {$semester_id} and l.semester_week = {$semester_week}");
            $grade_lists[$key]['ball'][] = $row['count'];
                //$countall += $row['count'];
                //女
            $row  = $this->db->fetchRow("select count(DISTINCT l.student_id) as count from `tbl_lack` as l , `tbl_student` as s where l.student_id = s.student_id  AND s.student_sex =0  AND l.disease_id = {$v['disease_id']} AND s.grade_id = {$value['grade_id']} and l.semester_id = {$semester_id} and l.semester_week = {$semester_week}");
            $grade_lists[$key]['gall'][] = $row['count'];
                //$countall += $row['count'];

            }

		}
        $percent = round($countall/$student_count['count']*100,2)."%";
		//var_dump($grade_lists);

		// 缺课登记列表
		$lack_lists = $this->db->fetchAll("SELECT b.*,a.* FROM `tbl_student` AS b,`tbl_lack` AS a WHERE a.student_id=b.student_id {$where} {$wheres}");
		
		foreach ($lack_lists as $key => $value){
			$out[$value['grade_id']]['all'][$value['student_sex']]++;
			$out[$value['grade_id']]['disease'][$value['disease_id']][$value['student_sex']]++;
		}

		$this->tpl->assign("disease_ini", $disease_ini);
		$this->tpl->assign("out", $out);
		$this->tpl->assign("baseset_data", $baseset_data);
		$this->tpl->assign("man_count", $man_count);

		$this->tpl->assign("woman_count", $woman_count);
		$this->tpl->assign("percent", $percent);
		$this->tpl->assign("explain_data", $explain_data);
		$this->tpl->assign("grade_lists", $grade_lists);

		$this->tpl->assign("student_count", $student_count);
		$this->tpl->assign("semester_lists", $semester_lists);
		$this->tpl->assign("semester_week", $semester_week);
		$this->tpl->assign("semester_time", $semester_time);
//var_dump($grade_lists);
		$this->tpl->assign("semester_data", $semester_data);
		$this->tpl->display('disease/m.week.list.tpl.php');
	}


	/** --------------------------------月报表--------------------------------- **/
	/** 月表 **/
	public function actionMonthDetails ()
	{
		// 学期学年
		$semester_lists = $this->db->fetchAll("SELECT * FROM `tbl_semester`");
		foreach($semester_lists as $key=>$value){
			$semester_lists[$key]['semester_name']=$this->semester_name[$value['semester_name']];
		}

		// 全部月份
		$month=$this->month_ini;
		foreach($month as $key=>$value){
			$month_lists[$key]['month_id']=$key;
			$month_lists[$key]['month_name']=$value;
		}
		// 学校信息
		$baseset_data = $this->db->fetchRow("SELECT * FROM `tbl_baseset` ");
		// 学校地区类别
		$baseset_data['baseset_area'] = $this->area_ini[$baseset_data['baseset_area']];
		// 地区类别
		$baseset_data['baseset_registered'] = $this->registered_ini[$baseset_data['baseset_registered']];
		// 登记说明
		$explain_data = $this->db->fetchRow("SELECT *  FROM `tbl_disease_explain` ");

		// 查询条件
		$semester_id	= $this->get->semester_id;
		$month_id		= $this->get->month_id;
		// 获得当前学期
        if(empty($semester_id)){
		$semester_data = $this->model->semester->getNew();
		//$semester_id   = $semester_data['semester_id'];
        }
		//当前时间
		$time =  date('Y-m-d',time());
			
		$where = "";

		if(!empty($semester_id)){
			$where .= " AND a.semester_id ='{$semester_id}'";
			print_R($semester_id);
			$this->tpl->assign("semester_id", $semester_id);
		}		
		if (!empty($month_id)) {
			$where .= " AND a.semester_month ='{$month_id}'";
			$semester_month = $month_id;
		}else {
			// 获得当前学期的月
			$semester_month = $this->model->semester->getWeekByTime($time);
            $month_id = $semester_month['semester_month'];
			$where .= " AND a.semester_month ='{$semester_month['semester_month']}'";
            //var_dump($semester_month);
		}

//echo $month_id;
					
		// 当前月开始时间结束时间
		$month_time = $this->model->semester->getMonthTimes($semester_id,$month_id);

		// 男生女生合计
		// 学生总人数
		$student_count = $this->db->fetchRow("SELECT COUNT(1) AS count FROM `tbl_student`");

		// 男所有人数
		$man_count = $this->db->fetchRow("SELECT COUNT(1) AS count FROM `tbl_student`AS a WHERE student_sex = '1' ");

		// 女所有人数
		$woman_count = ($student_count['count']-$man_count['count']);
		// 请假数量
		$row = (int)$this->db->fetchAll("SELECT count(DISTINCT student_id) FROM `tbl_lack`  WHERE  start_time >='{$month_time['start_time']}' AND start_time <= '{$month_time['end_time']}' ");

		//  出勤数量
		$row = (int)$student_count['count'] -$row;

		// 出勤率
		$percent = 1-round($row/$student_count['count']*100,2)."%";

		// 疾病列表
		$disease_lists = $this->db->fetchAll("SELECT disease_id,disease_name FROM `tbl_disease`");
		foreach ($disease_lists as $key => $value){
			$disease_ini[$value['disease_id']] = $value['disease_name'];
		}

		// 年级列表
//		$grade_lists = $this->db->fetchAll("SELECT grade_id,grade_name FROM `tbl_grade`");
//		foreach ($grade_lists as $key => $value){
//			$grade_ini[$value['grade_id']] = $value['grade_name'];
//
//			$out[$value['grade_id']]['name'] = $value['grade_name'];
//			$out[$value['grade_id']]['all'][0] = 0;
//			$out[$value['grade_id']]['all'][1] = 0;
//
//			foreach ($disease_ini as $k => $v){
//				$out[$value['grade_id']]['disease'][$k][0] = 0;
//				$out[$value['grade_id']]['disease'][$k][1] = 0;
//			}
//		}
        $countall = 0;
        // 年级列表
        $grade_lists = $this->db->fetchAll("SELECT grade_id,grade_name FROM `tbl_grade_up` WHERE is_now =1");
        foreach ($grade_lists as $key => $value){

            //男
            $row  = $this->db->fetchRow("select count(DISTINCT l.student_id) as count from `tbl_lack` as l , `tbl_student` as s where l.student_id = s.student_id AND s.student_sex =1 AND s.grade_id = {$value['grade_id']} and l.semester_id = '{$semester_id}' and l.semester_month = '{$month_id}'");
            $grade_lists[$key]['boy'] = $row['count'];
            $countall += $row['count'];
            //女
            $row  = $this->db->fetchRow("select count(DISTINCT l.student_id) as count from `tbl_lack` as l , `tbl_student` as s where l.student_id = s.student_id AND s.student_sex =0 AND s.grade_id = {$value['grade_id']}  and l.semester_id = '{$semester_id}' and l.semester_month = '{$month_id}'");
            $grade_lists[$key]['girl'] = $row['count'];
            $countall += $row['count'];

            foreach ($disease_lists as $k => $v){//疾病
                //男
                $row  = $this->db->fetchRow("select count(DISTINCT l.student_id) as count from `tbl_lack` as l , `tbl_student` as s where l.student_id = s.student_id AND s.student_sex =1 AND l.disease_id = {$v['disease_id']} AND s.grade_id = '{$value['grade_id']}' and l.semester_id = '{$semester_id}' and l.semester_month = '{$month_id}'");
                $grade_lists[$key]['ball'][] = $row['count'];
                //$countall += $row['count'];
                //女
                $row  = $this->db->fetchRow("select count(DISTINCT l.student_id) as count from `tbl_lack` as l , `tbl_student` as s where l.student_id = s.student_id  AND s.student_sex =0  AND l.disease_id = {$v['disease_id']} AND s.grade_id = '{$value['grade_id']}' and l.semester_id = '{$semester_id}' and l.semester_month = '{$month_id}'");
                $grade_lists[$key]['gall'][] = $row['count'];
                //$countall += $row['count'];
            }

        }
        $percent = round($countall/$student_count['count']*100,2)."%";
        //$this->tpl->assign('countall',$countall);
		// 缺课登记列表
		$lack_lists = $this->db->fetchAll("SELECT b.*,a.* FROM `tbl_student` AS b,`tbl_lack` AS a WHERE a.student_id=b.student_id {$where}");
//print_R("SELECT b.*,a.* FROM `tbl_student` AS b,`tbl_lack` AS a WHERE a.student_id=b.student_id {$where}");
		foreach ($lack_lists as $key => $value){
			$out[$value['grade_id']]['all'][$value['student_sex']]++;
			$out[$value['grade_id']]['disease'][$value['disease_id']][$value['student_sex']]++;
		}


		$this->tpl->assign("semester_lists", $semester_lists);
		$this->tpl->assign("semester_data", $semester_data);
		$this->tpl->assign("month_lists", $month_lists);
		$this->tpl->assign("semester_month", $semester_month);

		$this->tpl->assign("baseset_data", $baseset_data);
		$this->tpl->assign("explain_data", $explain_data);
		$this->tpl->assign("month_time", $month_time);
		$this->tpl->assign("grade_lists", $grade_lists);

		$this->tpl->assign("man_count", $man_count);
		$this->tpl->assign("woman_count", $woman_count);
		$this->tpl->assign("student_count", $student_count);
		$this->tpl->assign("percent", $percent);

		$this->tpl->assign("disease_ini", $disease_ini);
		$this->tpl->assign("out", $out);

		$this->tpl->display('disease/m.month.details.tpl.php');

	}
}

?>